import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import { WeaTools, WeaLocaleProvider, WeaTop, WeaTab, WeaDialog, WeaLeftRightLayout, WeaLeftTree, WeaTree, WeaFormItem, WeaSearchGroup, WeaRightMenu, WeaUpload, WeaCheckbox, WeaSelect, WeaInputNumber, WeaInput, WeaBrowser, WeaNewScroll, WeaButtonIcon, WeaAuth, WeaHelpfulTip, WeaAlertPage, WeaError } from 'ecCom';

const getLabel = WeaLocaleProvider.getLabel;
import { WeaTableNew, WeaSwitch } from 'comsMobx';

const WeaTable = WeaTableNew.WeaTable;
import { Button, Form, Modal, message } from 'antd';
import HighSeasConditionDialog from '../dialog/HighSeasConditionDialog';

@inject('highSeasSettingFormStore')
@observer
class HighSeasSettingForm extends React.Component {
  constructor(props) {
    super(props);
  }

  componentDidMount() {
    const { highSeasSettingFormStore, highSeasSettingListStore } = this.props;
    const params = {};
    if (highSeasSettingListStore) {
      if (highSeasSettingListStore.editId) {
        params.editId = highSeasSettingListStore.editId;
      }
      if (highSeasSettingListStore.operate == 'edit') {
        params.operate = highSeasSettingListStore.operate;
        highSeasSettingFormStore.initForm(params, this);
      }

      if (highSeasSettingListStore.operate == 'add') {
        params.operate = highSeasSettingListStore.operate;
        delete params.editId;
        highSeasSettingFormStore.initForm(params, this);
      }
    }
  }

  // componentWillUnMount(){
  //     const {highSeasSettingFormStore,highSeasSettingListStore} = this.props;
  //     highSeasSettingFormStore
  // }

  // componentWillUpdate(nextProps){
  //     console.log(1111);

  //     const {highSeasSettingListStore} = nextProps;
  //     console.log(toJS(highSeasSettingListStore));
  // }

  // componentWillReceiveProps(nextProps){

  // }

  render() {
    const { highSeasSettingFormStore, highSeasSettingListStore } = this.props;
    const { formInfo, tabKey, seasNum, tableStore1, tableStore2, right, verified } = highSeasSettingFormStore;

    if (verified && right == '') {
      return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@oq3blm`} >
        <div style={{ color: '#000' }}>
          {getLabel(2012, '对不起，您暂时没有权限！')}
        </div>
      </WeaAlertPage>
      );
    }

    const rightMenus = [];
    right && tabKey == 0 && rightMenus.push({ disabled: highSeasSettingListStore.loading || highSeasSettingListStore.dialogInfo.disabled, key: 'save', icon: <i className="icon-coms-Preservation" />, content: getLabel(86, '保存', 'label'), onClick: () => highSeasSettingListStore.controlOperateDialog('save', highSeasSettingFormStore.initForm, toJS(formInfo)) });
    rightMenus.push({ key: 'toback', icon: <i className="icon-coms-go-back" />, content: getLabel(309, '关闭'), onClick: () => highSeasSettingListStore.controlOperateDialog('toback', '') });

    const topTab = [];
    topTab.push({ title: getLabel(24893, '基础信息'), viewcondition: 0 });
    highSeasSettingListStore.operate == 'edit' && topTab.push({ title: getLabel('386686', '查询权限'), viewcondition: 1 });
    highSeasSettingListStore.operate == 'edit' && topTab.push({ title: getLabel('387175', '分配/审批权限'), viewcondition: 2 });

    const content = this.getContent(highSeasSettingFormStore, highSeasSettingListStore);

    if (verified && right != '') {
      return (
        <div style={{ height: '600px' }}>
          <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@rggscj`} datas={rightMenus} >
            <WeaTab
              ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@1gfhfw`}
              datas={topTab}
              keyParam="viewcondition" // 主键
              selectedKey={tabKey}
              onChange={v => highSeasSettingFormStore.changeTab(v)}
              buttons={[]}
            />
            <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@hmik8a`} height={'calc(100% - 50px)'}>
              {content}
            </WeaNewScroll>
          </WeaRightMenu>


        </div>
      );
    }
    return <div />;
  }

    getContent = (highSeasSettingFormStore, highSeasSettingListStore) => {
      const { formInfo, tabKey, tableStore1, tableStore2, right, visible, checkCrmNumModel, conditionDialogStore } = highSeasSettingFormStore;
      const underline = (right == '');
      const group = [];
      // 关闭确认
      group.push(
        <Modal
          ecId={`${this && this.props && this.props.ecId || ''}_Modal@xxbl5a@modal`}
          ref="modal"
          closable={false}
          visible={checkCrmNumModel.visible}
          width={400}
          title="对话框标题"
          onOk={() => highSeasSettingFormStore.checkCrmNumOnOK()}
          onCancel={() => {}}
          footer={[
            <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@x5a8zj@cancel`} key="back" disabled={checkCrmNumModel.disabled} type="ghost" size="large" onClick={() => highSeasSettingFormStore.checkCrmNumOnCancel()}>{getLabel('201', '取消')}</Button>,
            <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@897t01@submit`} key="submit" type="primary" size="large" loading={checkCrmNumModel.loading} onClick={() => highSeasSettingFormStore.checkCrmNumOnOK()}>{getLabel('615', '提交')}</Button>,
          ]}
        >
          <div>
            <div>
              {getLabel('386706', '公海关闭，影响客户数为：')}<span style={{ color: 'red' }}>{checkCrmNumModel.nums.num1}</span>{getLabel('386708', '个！')}
              <br />
              {getLabel('386707', '且正在申领中的客户数为：')}<span style={{ color: 'red' }}>{checkCrmNumModel.nums.num2}</span>{getLabel('386708', '个！')}
            </div>
            <br />
            {checkCrmNumModel.nums && checkCrmNumModel.nums.num1 > 0 && <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@mj6fzo@manager`} label={getLabel('386709', '指定客户经理')} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
              <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@nrosu4@error`} style={{ width: '100%' }} tipPosition="top" ref={ref => highSeasSettingFormStore.manager4close = ref} error={getLabel('386709', '指定客户经理') + getLabel(82241, '不能为空!')}>
                <WeaBrowser
                  ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@lr32ro@browser`}
                  type={1}
                  textDecoration
                  viewAttr={3}
                  onChange={(ids, names, datas) => highSeasSettingFormStore.seasClose({ manager: ids })}
                />
              </WeaError>
            </WeaFormItem>}
          </div>
        </Modal>,
      );
      if (tabKey == 0) {
        group.push(
          <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@r6dap3@general`} needTigger title={getLabel('386688', '一般信息')} showGroup >
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@posywc@open`} label={getLabel(32165, '是否开启')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaCheckbox
                ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@145o3w@checkbox`}
                helpfulTip={getLabel(386683, '关闭公海需分配已在此公海中的客户！')}
                helpfulTipProps={{ width: 220 }}
                display="switch"
                style={{ display: 'inline' }}
                value={formInfo.status}
                onChange={v => highSeasSettingFormStore.checkCrmNum(v)}
                viewAttr={right == '' ? 1 : 2}
                underline={underline}
              />

            </WeaFormItem>
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@1urt2j@name`} label={getLabel(386684, '公海名称')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <div style={{ width: 250 }}>
                <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@a1vsxf@name`} tipPosition="top" ref="name" error={getLabel(386684, '公海名称') + getLabel(82241, '不能为空!')}>
                  <WeaInput
                    ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@2ufl9s@input`}
                    hasBorder={false}
                    style={{ width: 250 }}
                    viewAttr={right == '' ? 1 : 3}
                    value={formInfo.name}
                    onChange={v => this.inputChange({ name: v })}
                    underline={underline}
                  />
                </WeaError>
              </div>
            </WeaFormItem>
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@30opfc@manager`} label={getLabel('2097', '负责人')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@6o10fz@manager`} tipPosition="top" ref="manager" error={getLabel('2097', '负责人') + getLabel('82241', '不能为空!')}>
                <WeaBrowser
                  ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@eq0req@browser`}
                  type={1}
                  title={getLabel('2097', '负责人')}
                  textDecoration
                  inputStyle={{ width: 250 }}
                  viewAttr={(!formInfo.editId || formInfo.editId == '') ? 3 : 1}
                  replaceDatas={formInfo.managerReplaceDatas}
                  onChange={(ids, names, datas) => this.inputChange({ manager: ids, managerReplaceDatas: [{ id: ids, name: names }] })}
                  underline={(right == '' || formInfo.editId != '')}
                  helpfulTip={getLabel('387133', '负责人所有下属的客户，将按下面规则回归至公海')}
                />
              </WeaError>
            </WeaFormItem>
          </WeaSearchGroup>,
        );

        formInfo.status == '1' && group.push(
          <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@kt7sf8@set`} needTigger title={getLabel('386689', '回归设置')} showGroup >
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@0r9sfi@rules`} label={getLabel('386690', '指定规则')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaSelect
                ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@y654ms@select`}
                options={[{
                  key: '1',
                  showname: getLabel(84384, '未联系'),
                }]}
                detailtype={3}
                value={'1'}
                onChange={(v) => {}}
                viewAttr={right == '' ? 1 : 3}
              />
            </WeaFormItem>
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@4ifjl7@timeline`} label={getLabel('386691', '回归期限1')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <div style={{ width: 100, float: 'left' }}>
                <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@y12f40@error`} tipPosition="top" ref="commonUnrelated" error={getLabel('82241', '不能为空!')}>
                  <WeaInputNumber
                    ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@3g5z1p@number`}
                    value={formInfo.commonUnrelated}
                    onChange={v => this.inputChange({ commonUnrelated: v })}
                    min={1}
                    viewAttr={right == '' ? 1 : 3}
                    underline={underline}
                  />
                </WeaError>
              </div>
              <div style={{ float: 'left', padding: '4px 15px' }}>{getLabel('386692', '天未联系客户，普通客户将自动回归公海！')}</div>
            </WeaFormItem>
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@eu93yr@timeline`} label={getLabel('386693', '回归期限2')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <div style={{ float: 'left', padding: '4px 0px' }}>{getLabel('386694', '公海领取/分配客户，')}</div>
              <div style={{ width: 100, float: 'left' }}>
                <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@4ue7ae@error`} tipPosition="top" ref="seasUnrelated" error={getLabel('82241', '不能为空!')}>
                  <WeaInputNumber
                    ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@nc5oo1@number`}
                    value={formInfo.seasUnrelated}
                    onChange={v => this.inputChange({ seasUnrelated: v })}
                    min={1}
                    viewAttr={right == '' ? 1 : 3}
                    underline={underline}
                  />
                </WeaError>
              </div>
              <div style={{ float: 'left', padding: '4px 15px' }}>{getLabel('386695', '天未联系，客户将重新回归公海！')}</div>
            </WeaFormItem>
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@eg8xfx@workflowRemind`} label={getLabel('23042', '流程提醒')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaSelect
                ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@ok3fhs@select`}
                options={[{
                  key: '1',
                  showname: getLabel('386696', '客户经理本人'),
                }, {
                  key: '2',
                  showname: getLabel('386697', '客户经理直接上级'),
                }]}
                detailtype={2}
                viewAttr={right == '' ? 1 : 2}
                value={formInfo.remind}
                onChange={v => this.inputChange({ remind: v })}
                underline={underline}
              />
            </WeaFormItem>
          </WeaSearchGroup>,
        );

        formInfo.status == '1' && group.push(
          <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@tl6xrx@scope`} needTigger title={getLabel('386699', '客户范围')} showGroup >
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@6w8vxw@customer`} label={getLabel('18647', '指定客户')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <div style={{ float: 'left' }}>
                <WeaSelect
                  ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@kun0kc@select`}
                  options={[{
                    key: '1',
                    showname: getLabel('386700', '指定范围'),
                  }]}
                  detailtype={3}
                  value={'1'}
                  onChange={(v) => {}}
                  viewAttr={right == '' ? 1 : 3}
                />
              </div>
              <div style={{ float: 'left' }}>
                <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5pmfeq@scope`} type="primary" disabled={right == ''} onClick={() => highSeasSettingFormStore.onShow()}>{getLabel('387132', '指定客户范围')}</Button>
                <WeaHelpfulTip
                  ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@dmgdn7@help`}
                  style={{ paddingLeft: '5px' }}
                  width={220} // 如果要自定义宽度，在这里设置
                  title={getLabel('387158', '添加指定范围后，将按照此规则回收客户至公海中，保存后即可生效')}
                />
              </div>

              {visible && conditionDialogStore.visible && <HighSeasConditionDialog ecId={`${this && this.props && this.props.ecId || ''}_HighSeasConditionDialog@7lmg45@dialog`} store={conditionDialogStore} />}
            </WeaFormItem>

            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@gzobm8@subcompany`} label={getLabel('19437', '指定分部')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaBrowser
                ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@hbckpl@browser`}
                type={194}
                title={getLabel('19437', '指定分部')}
                isSingle={false}
                textDecoration
                inputStyle={{ width: 400 }}
                viewAttr={2}
                replaceDatas={formInfo.subcompanyReplaceDatas || []}
                onChange={(ids, names, datas) => this.inputChange({ subcompany: ids, subcompanyReplaceDatas: [{ id: ids, name: names }] })}
                underline={(right == '' || formInfo.editId != '')}
                tabs={[{
                  isSearch: false,
                  key: '1',
                  name: getLabel('18770', '按组织结构'),
                  selected: false,
                }, {
                  isSearch: false,
                  key: '2',
                  name: getLabel('130619', '按列表'),
                  selected: false,
                  dataParams: {
                    list: '1',
                  },
                }]}
                helpfulTip={''}
              />
            </WeaFormItem>
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@eqvriy@dept`} label={getLabel('19438', '指定部门')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaBrowser
                ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@2cdmi8@browser`}
                type={57}
                title={getLabel('19438', '指定部门')}
                isSingle={false}
                textDecoration
                inputStyle={{ width: 400 }}
                viewAttr={2}
                replaceDatas={formInfo.departmentReplaceDatas || []}
                onChange={(ids, names, datas) => this.inputChange({ department: ids, departmentReplaceDatas: [{ id: ids, name: names }] })}
                underline={(right == '' || formInfo.editId != '')}
                tabs={[{
                  isSearch: false,
                  key: '1',
                  name: getLabel('18770', '按组织结构'),
                  selected: false,
                }, {
                  isSearch: false,
                  key: '2',
                  name: getLabel('130619', '按列表'),
                  selected: false,
                  dataParams: {
                    list: '1',
                  },
                }]}
              />
            </WeaFormItem>
          </WeaSearchGroup>,
        );

        formInfo.status == '1' && group.push(
          <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@4gv78f@set`} needTigger title={getLabel('386701', '预警设置')} showGroup >
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@qgtsjb@open`} label={getLabel('386702', '开启预警')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaCheckbox
                ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@ywi3ld@checkbox`}
                display="switch"
                style={{ display: 'inline' }}
                value={formInfo.warnStatus}
                onChange={v => this.inputChange({ warnStatus: v })}
                viewAttr={right == '' ? 1 : 2}
              />
            </WeaFormItem>
            {formInfo.warnStatus == '1' && <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@9x83jv@timeline`} label={getLabel('386703', '预警期限')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <div style={{ float: 'left', padding: '4px 0px' }}>{getLabel('386704', '回归公海前')}&nbsp;&nbsp;&nbsp;</div>
              <div style={{ width: 100, float: 'left' }}>
                <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@rd5hig@error`} tipPosition="top" ref="warnDay" error={getLabel('82241', '不能为空!')}>
                  <WeaInputNumber
                    ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@v492fa@number`}
                    value={formInfo.warnDay}
                    onChange={v => this.inputChange({ warnDay: v })}
                    min={1}
                    max={formInfo.commonUnrelated || 1}
                    viewAttr={right == '' ? 1 : 3}
                  />
                </WeaError>
              </div>
              <div style={{ float: 'left', padding: '4px 15px' }}>{getLabel('386705', '天！')}</div>
            </WeaFormItem>}
            {formInfo.warnStatus == '1' && <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@bvfl4q@workflowRemind`} label={getLabel('23042', '流程提醒')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
              <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@40412p@workflowRemind`} tipPosition="top" ref="warnRemind" error={getLabel('23042', '流程提醒') + getLabel('82241', '不能为空!')}>
                <WeaSelect
                  ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@t4zeqg@select`}
                  options={[{
                    key: '1',
                    showname: getLabel('386696', '客户经理本人'),
                  }, {
                    key: '2',
                    showname: getLabel('386697', '客户经理直接上级'),
                  }]}
                  detailtype={2}
                  viewAttr={right == '' ? 1 : 3}
                  value={formInfo.warnRemind}
                  onChange={v => this.inputChange({ warnRemind: v })}
                />
              </WeaError>
            </WeaFormItem>}
          </WeaSearchGroup>,
        );
      } else if (tabKey == 1) {
        const shareCondition = [
          {
            colSpan: 2,
            conditionType: 'SELECT',
            domkey: [
              'sharetype',
            ],
            fieldcol: 14,
            isQuickSearch: false,
            label: getLabel(21956, '对象类型'),
            labelcol: 6,
            options: [
              {
                key: '1',
                selected: true,
                showname: getLabel(179, '人力资源'),
              }, {
                key: '2',
                selected: false,
                showname: getLabel(124, '部门'),
              }, {
                key: '3',
                selected: false,
                showname: getLabel(122, '角色'),
              },
            ],
            viewAttr: 2,
          }, {
            2: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '57',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  100,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  },
                  // , {
                  //     "key": "2",
                  //     "selected": false,
                  //     "showname": getLabel(93,"编辑")
                  // }
                ],
                viewAttr: 2,
              },
            ],
            ],
            5: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '194',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                value: 3,
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  0,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(93, '编辑'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            1: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '17',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  },
                  // , {
                  //     "key": "2",
                  //     "selected": false,
                  //     "showname": getLabel(93,"编辑")
                  // }
                ],
                viewAttr: 2,
              },
            ],
            ],
            6: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '278',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT_LINKAGE',
                domkey: [
                  'jobtitlelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(28169, '岗位级别'),
                labelcol: 6,
                options: [
                  {
                    key: '0',
                    selected: true,
                    showname: getLabel(140, '总部'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(19437, '指定分部'),
                  }, {
                    key: '1',
                    selected: false,
                    showname: getLabel(19438, '指定部门'),
                  },
                ],
                selectLinkageDatas: {
                  1: {
                    browserConditionParam: {
                      completeParams: {},
                      conditionDataParams: {},
                      dataParams: {},
                      destDataParams: {},
                      hasAddBtn: false,
                      hasAdvanceSerach: true,
                      idSeparator: ',',
                      isAutoComplete: 1,
                      isDetail: 0,
                      isMultCheckbox: false,
                      isSingle: false,
                      pageSize: 10,
                      quickSearchName: '',
                      type: '57',
                      viewAttr: 3,
                    },
                    colSpan: 2,
                    conditionType: 'BROWSER',
                    domkey: [
                      'jobtitledepartment',
                    ],
                    fieldcol: 14,
                    isQuickSearch: false,
                    label: '',
                    labelcol: 6,
                    viewAttr: 3,
                  },
                  2: {
                    browserConditionParam: {
                      completeParams: {},
                      conditionDataParams: {},
                      dataParams: {},
                      destDataParams: {},
                      hasAddBtn: false,
                      hasAdvanceSerach: true,
                      idSeparator: ',',
                      isAutoComplete: 1,
                      isDetail: 0,
                      isMultCheckbox: false,
                      isSingle: false,
                      pageSize: 10,
                      quickSearchName: '',
                      type: '194',
                      viewAttr: 3,
                    },
                    colSpan: 2,
                    conditionType: 'BROWSER',
                    domkey: [
                      'jobtitlesubcompany',
                    ],
                    fieldcol: 14,
                    isQuickSearch: false,
                    label: '',
                    labelcol: 6,
                    viewAttr: 3,
                  },
                },
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(93, '编辑'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            4: [[
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  100,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(93, '编辑'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            3: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '65',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              }, {
                colSpan: 2,
                conditionType: 'SELECT',
                className: 'crm-select',
                domkey: [
                  'rolelevel',
                ],
                fieldcol: 8,
                isQuickSearch: false,
                label: getLabel(139, '级别'),
                labelcol: 4,
                options: [
                  {
                    key: '0',
                    selected: true,
                    showname: getLabel(124, '部门'),
                  }, {
                    key: '1',
                    selected: false,
                    showname: getLabel(141, '分部'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(140, '总部'),
                  },
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  100,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  },
                  // , {
                  //     "key": "2",
                  //     "selected": false,
                  //     "showname": getLabel(93,"编辑")
                  // }
                ],
                viewAttr: 2,
              },
            ],
            ],
          },
        ];
        const disabled = tableStore1.selectedRowKeys.length == 0;
        const rightButtons = [];
        right != '' && rightButtons.push(<div style={{ float: 'right' }} ><WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@spxht0@wbi`} disabled={disabled} buttonType="del" type="primary" onClick={() => highSeasSettingFormStore.deleteAuth('t1')} /></div>);
        right != '' && rightButtons.push(<div style={{ float: 'right', paddingRight: '7px' }} ><WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@l95wn3@wbi`} style={{ float: 'right' }} buttonType="add" type="primary" onClick={() => this.refs.auth1.onOk()} /></div>);
        group.push(

          <WeaAuth
            ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@r0j5cb@auth`}
            ref="auth1"
            type={'form'}
            // style={{width:800,height:500}}
            conditions={shareCondition}
            title={getLabel('386710', '权限添加')}
            icon={'icon-coms-crm'}
            iconBgcolor="#96358a"
            onOk={(v) => {
              // console.log('onOk datas: ', v);
              // highSeasSettingFormStore.changeAuthDialog(false)
              highSeasSettingFormStore.saveAuthInfo({ ...v, table: 't1' });
            }}
          />,
          <div style={{ height: '25px', paddingRight: '10px' }}>{rightButtons}</div>
          ,
          <WeaTable
            ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@wjiulj@table`}
            comsWeaTableStore={tableStore1}
            hasOrder
            needScroll
          />,
          // <WeaAuth
          //         style={{width:800,height:500}}
          //         conditions={shareCondition}
          //         title={getLabel(18645,"添加共享")}
          //         icon={"icon-coms-crm"}
          //         iconBgcolor="#96358a"
          //         onOk={v => {
          //             // console.log('onOk datas: ', v);
          //             saveShareSetting({...v,customerId:customerId});
          //             shareStore.handleShareDialog(false);
          //         }}
          //         onCancel={() => highSeasSettingFormStore.changeAuthDialog(false)}
          //     />
        );
      } else if (tabKey == 2) {
        const shareCondition = [
          {
            colSpan: 2,
            conditionType: 'SELECT',
            domkey: [
              'sharetype',
            ],
            fieldcol: 14,
            isQuickSearch: false,
            label: getLabel(21956, '对象类型'),
            labelcol: 6,
            options: [
              {
                key: '1',
                selected: true,
                showname: getLabel(179, '人力资源'),
              }, {
                key: '2',
                selected: false,
                showname: getLabel(124, '部门'),
              }, {
                key: '3',
                selected: false,
                showname: getLabel(122, '角色'),
              },
            ],
            viewAttr: 2,
          }, {
            2: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '57',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  100,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  // {
                  //     "key": "1",
                  //     "selected": true,
                  //     "showname": getLabel(367,"查看")
                  // },
                  {
                    key: '2',
                    selected: true,
                    showname: getLabel('387173', '分配/申请'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            5: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '194',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                value: 3,
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  0,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(93, '编辑'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            1: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '17',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  // {
                  //     "key": "1",
                  //     "selected": true,
                  //     "showname": getLabel(367,"查看")
                  // },
                  {
                    key: '2',
                    selected: true,
                    showname: getLabel('387174', '分配/审批'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            6: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '278',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT_LINKAGE',
                domkey: [
                  'jobtitlelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(28169, '岗位级别'),
                labelcol: 6,
                options: [
                  {
                    key: '0',
                    selected: true,
                    showname: getLabel(140, '总部'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(19437, '指定分部'),
                  }, {
                    key: '1',
                    selected: false,
                    showname: getLabel(19438, '指定部门'),
                  },
                ],
                selectLinkageDatas: {
                  1: {
                    browserConditionParam: {
                      completeParams: {},
                      conditionDataParams: {},
                      dataParams: {},
                      destDataParams: {},
                      hasAddBtn: false,
                      hasAdvanceSerach: true,
                      idSeparator: ',',
                      isAutoComplete: 1,
                      isDetail: 0,
                      isMultCheckbox: false,
                      isSingle: false,
                      pageSize: 10,
                      quickSearchName: '',
                      type: '57',
                      viewAttr: 3,
                    },
                    colSpan: 2,
                    conditionType: 'BROWSER',
                    domkey: [
                      'jobtitledepartment',
                    ],
                    fieldcol: 14,
                    isQuickSearch: false,
                    label: '',
                    labelcol: 6,
                    viewAttr: 3,
                  },
                  2: {
                    browserConditionParam: {
                      completeParams: {},
                      conditionDataParams: {},
                      dataParams: {},
                      destDataParams: {},
                      hasAddBtn: false,
                      hasAdvanceSerach: true,
                      idSeparator: ',',
                      isAutoComplete: 1,
                      isDetail: 0,
                      isMultCheckbox: false,
                      isSingle: false,
                      pageSize: 10,
                      quickSearchName: '',
                      type: '194',
                      viewAttr: 3,
                    },
                    colSpan: 2,
                    conditionType: 'BROWSER',
                    domkey: [
                      'jobtitlesubcompany',
                    ],
                    fieldcol: 14,
                    isQuickSearch: false,
                    label: '',
                    labelcol: 6,
                    viewAttr: 3,
                  },
                },
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(93, '编辑'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            4: [[
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  100,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  {
                    key: '1',
                    selected: true,
                    showname: getLabel(367, '查看'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(93, '编辑'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
            3: [[
              {
                browserConditionParam: {
                  completeParams: {},
                  conditionDataParams: {},
                  dataParams: {},
                  destDataParams: {},
                  hasAddBtn: false,
                  hasAdvanceSerach: true,
                  idSeparator: ',',
                  isAutoComplete: 1,
                  isDetail: 0,
                  isMultCheckbox: false,
                  isSingle: false,
                  pageSize: 10,
                  quickSearchName: '',
                  type: '65',
                  viewAttr: 3,
                },
                colSpan: 2,
                conditionType: 'BROWSER',
                domkey: [
                  'relatedshareid',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(106, '对象'),
                labelcol: 6,
                viewAttr: 3,
              }, {
                colSpan: 2,
                conditionType: 'SELECT',
                className: 'crm-select',
                domkey: [
                  'rolelevel',
                ],
                fieldcol: 8,
                isQuickSearch: false,
                label: getLabel(139, '级别'),
                labelcol: 4,
                options: [
                  {
                    key: '0',
                    selected: true,
                    showname: getLabel(124, '部门'),
                  }, {
                    key: '1',
                    selected: false,
                    showname: getLabel(141, '分部'),
                  }, {
                    key: '2',
                    selected: false,
                    showname: getLabel(140, '总部'),
                  },
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'INPUT_INTERVAL',
                domkey: [
                  'seclevel',
                  'seclevelMax',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(683, '安全级别'),
                labelcol: 6,
                value: [
                  10,
                  100,
                ],
                viewAttr: 2,
              },
            ], [
              {
                colSpan: 2,
                conditionType: 'SELECT',
                domkey: [
                  'sharelevel',
                ],
                fieldcol: 14,
                isQuickSearch: false,
                label: getLabel(385, '权限'),
                labelcol: 6,
                options: [
                  // {
                  //     "key": "1",
                  //     "selected": true,
                  //     "showname": getLabel(367,"查看")
                  // },
                  {
                    key: '2',
                    selected: true,
                    showname: getLabel('387174', '分配/审批'),
                  },
                ],
                viewAttr: 2,
              },
            ],
            ],
          },
        ];
        const disabled = tableStore2.selectedRowKeys.length == 0;
        const rightButtons = [];
        right != '' && rightButtons.push(<div style={{ float: 'right' }} ><WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@a6a91b@wbi`} disabled={disabled} buttonType="del" type="primary" onClick={() => highSeasSettingFormStore.deleteAuth('t2')} /></div>);
        right != '' && rightButtons.push(<div style={{ float: 'right', paddingRight: '7px' }} ><WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@u5fotz@wbi`} style={{ float: 'right' }} buttonType="add" type="primary" onClick={() => this.refs.auth2.onOk()} /></div>);
        group.push(
          <WeaAuth
            ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@ll3wvv@auth`}
            ref="auth2"
            type={'form'}
            // style={{width:800,height:500}}
            conditions={shareCondition}
            title={getLabel('386710', '权限添加')}
            icon={'icon-coms-crm'}
            iconBgcolor="#96358a"
            onOk={(v) => {
              // console.log('onOk datas: ', v);
              // highSeasSettingFormStore.changeAuthDialog(false)
              highSeasSettingFormStore.saveAuthInfo({ ...v, table: 't2' });
            }}
          />,
          <div style={{ height: '25px', paddingRight: '10px' }}>{rightButtons}</div>
          ,
          <WeaTable
            ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@fyy58e@table`}
            comsWeaTableStore={tableStore2}
            hasOrder
            needScroll
          />,
        );
      }


      return group;
    }

    inputChange = (params) => {
      const { highSeasSettingFormStore } = this.props;
      highSeasSettingFormStore.setFormInfo(params);
    }

    checkForm=(params) => {
      const { status, name, manager, commonUnrelated, seasUnrelated, remind, warnStatus, warnDay, warnRemind } = params;
      if (!name) {
        this.refs.name.showError();
      }
      if (!manager) {
        this.refs.manager.showError();
      }

      if (status == '1') {
        if (!commonUnrelated) {
          this.refs.commonUnrelated.showError();
        }
        if (!seasUnrelated) {
          this.refs.seasUnrelated.showError();
        }


        if (warnStatus == '1') {
          if (!warnDay) {
            this.refs.warnDay.showError();
          }
          if (!warnRemind) {
            this.refs.warnRemind.showError();
          }
        }
      }

      let bool = false;
      if (status == '1') {
        if (name && manager && (commonUnrelated || commonUnrelated == 0) && (seasUnrelated || seasUnrelated == 0)) {
          bool = true;
          if (warnStatus == '1') {
            if ((warnDay || warnDay == 0) && warnRemind) {
              bool = true;
            } else {
              bool = false;
            }
          }
        }
      } else if (name && manager) {
        bool = true;
      }
      return bool;
    }
}
export default WeaTools.tryCatch(React,
  props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@z69dpj`} msg={props.error ? props.error : getLabel(129417, '服务器运行出错，请联系系统管理员！')} />,
  { error: '' },
)(HighSeasSettingForm);
